home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
qbprog.EXE
/
ROMENDEN.BAS
< prev
next >
Wrap
BASIC Source File
|
1995-05-12
|
2KB
|
37 lines
10 DIM H$(50),R(50):CLS:' ROMEN RAKAMINDAN ÇEVÿRÿ YAPAN PROGRAM. ROMENDEN.BAS
20 INPUT "SAYIYI GIRIN ",S$: 'MURAT NECÿOªLU
30 HA$=CHR$(10)+"HATALI GIRIS"
40 S=LEN(S$)
50 IF S>15 THEN PRINT HA$ :PRINT:BEEP:END
60 FOR Q=1 TO S
70 H$(Q)=MID$(S$,Q,1) : NEXT
80 FOR Q=1 TO S
90 IF H$(Q)="I" THEN R(Q)=1 :I=I+1:IF I>4 THEN PRINT HA$:END ELSE GOTO 170
100 IF H$(Q)="V" THEN R(Q)=5 :V=V+1:IF V>1 THEN PRINT HA$:END ELSE GOTO 170
110 IF H$(Q)="X" THEN R(Q)=10 :X=X+1:IF X>4 THEN PRINT HA$:END ELSE GOTO 170
120 IF H$(Q)="L" THEN R(Q)=50 :L=L+1:IF L>1 THEN PRINT HA$:END ELSE GOTO 170
130 IF H$(Q)="C" THEN R(Q)=100 :C=C+1:IF C>4 THEN PRINT HA$:END ELSE GOTO 170
140 IF H$(Q)="D" THEN R(Q)=500 :D=D+1:IF D>1 THEN PRINT HA$:END ELSE GOTO 170
150 IF H$(Q)="M" THEN R(Q)=1000:M=M+1:IF M>4 THEN PRINT HA$:END ELSE GOTO 170
160 H=1
170 IF H=1 THEN PRINT:PRINT "ROMEN RAKAMI YAZILMADI":SOUND 3000,5:END ELSE NEXT
180 T=T+R(S):
190 FOR Q=S TO 2 STEP -1
200 IF R(Q-2)<R(Q-1) AND R(Q)>R(Q-1) THEN PRINT HA$:SOUND 1000,5:END
210 IF R(Q)=R(Q-2) AND R(Q)<R(Q-1) THEN PRINT HA$:SOUND 1500,7:END
220 '
230 IF R(Q-1)>=R(Q) THEN T=T+R(Q-1) ELSE GOSUB 270:T=T-R(Q-1)
240 NEXT
250 CLS: PRINT S$;"=";T
260 END
270 '
280 IF R(Q-2)=R(Q-1) THEN PRINT HA$:SOUND 2500,5:END
290 IF R(Q-1)=1 THEN 340
300 IF R(Q-1)=10 THEN 350
310 IF R(Q-1)=100 THEN 360
320 PRINT HA$: SOUND 5500,10 : END
330 '
340 IF R(Q)=5 OR R(Q)=10 THEN RETURN ELSE PRINT HA$:SOUND 3500,5:END
350 IF R(Q)=50 OR R(Q)=100 THEN RETURN ELSE PRINT HA$:SOUND 4000,5:END
360 IF R(Q)=500 OR R(Q)=1000 THEN RETURN ELSE PRINT HA$:SOUND 5000,10